home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / q4tool.zip / Q4TOOL.DOC < prev    next >
Text File  |  1990-08-19  |  39KB  |  891 lines

  1.  
  2.  
  3.                             The Q4Tool Library [Q4T]
  4.                                     Ver. 1.2
  5.                       Library Routines for QuickBASIC 4.x
  6.                         by  R. J. Crouch  -  August 1990
  7.                           Copyright - 1990 - CareWare
  8.                               All Rights Reserved
  9.                    _________________________________________
  10.  
  11.  
  12.  
  13.                       **   What is the Q4Tool Library?  **
  14.                      ======================================
  15.  
  16.  
  17.           Q4Tool  is  a  small  collection  of  innovative  and direct
  18.           programming tools, in  the  form  of  a  user  library,  for
  19.           Microsoft (R), QuickBASIC 4.xx [QB].  These library routines
  20.           are intended for use by individuals with some QB programming
  21.           experience.  The following files make up the Q4Tool Library.
  22.  
  23.             Primary:  Q4T.LIB  -  Q4T.QLB  -  Q4T.BI  -  Q4TOOL.DOC
  24.  
  25.             Support:  Q4T-DEMO.BAS  -  Q4T-DEMO.EXE  -  SHOWMENU.OBJ
  26.  
  27.           Q4Tool  [Q4T]  has  emerged  from  a  necessity for a simple
  28.           collection of comprehensive routines to supplement the BASIC
  29.           language.  All of its routines are easily incorporated  into
  30.           almost any QuickBASIC 4.xx source without greatly increasing
  31.           the efficient size of the "stand-alone" program.  The Q4Tool
  32.           Library is intended as a  solid  foundation  from  which  to
  33.           build your own personal libraries.
  34.  
  35.  
  36.  
  37.                    **   What the Q4Tool Library provides   **
  38.                   ============================================
  39.  
  40.  
  41.           Mouse Services:  Mouse*()
  42.  
  43.           A  majority  of  the  routines  in  Q4T  pertain  to   mouse
  44.           functions.   These  functions  will  allow  a  programmer to
  45.           incorporate the much needed  mouse  services  into  any  de-
  46.           manding  application.   They  are  intelligently  written to
  47.           compensate for a few idiosyncrasies that tend to emerge from
  48.           the mouse interrupt (33H).
  49.  
  50.  
  51.           Windowing:  DoWindow()
  52.  
  53.           Windowing  for  todays  applications  is  not  new, but this
  54.           windowing routine adds a few features that will enhance  any
  55.           program.   The  screen write for this routine is serviced by
  56.           machine code for  a  fast  and  clean  appearance.   Select-
  57.           ability for title location, type and location of shadow, and
  58.           a solid frame, make this windowing routine unique from other
  59.           we have seen.
  60.  
  61.  
  62.           Screen save/restore:  PutScrn()/GetScrn()
  63.  
  64.           The ability to save and later restore a screens contents are
  65.           essential  for contemporary programming.  These two routines
  66.           are designed to work within the QB environment.   They  make
  67.           use  of  QB's string descriptor block for ease of use.  This
  68.           pair of routines is written entirely  of  machine  code  for
  69.           instant results.
  70.  
  71.  
  72.           Screen print:  PrtScrn()
  73.  
  74.           This is a little machine code routine that will print to the
  75.           screen,  at the location and color desired, any string vari-
  76.           able.  It's fast, compact, and incorporates  into  just  one
  77.           CALL,  QB's  LOCATE,  COLOR,  and  PRINT  statements.   This
  78.           routine is the heart of  the  windowing  procedure  and  the
  79.           reason for its speed.
  80.  
  81.  
  82.           Screen string centering:  Ctr()
  83.  
  84.           This  is  a  handy  little  function that returns the column
  85.           position needed to center string data or  variables  on  the
  86.           screen.   It  can  easily  be  incorporated into QB's LOCATE
  87.           statement.  [i.e., LOCATE 12, Ctr(strg$)]
  88.  
  89.  
  90.           Program delays:  Delay()
  91.  
  92.           This  is  a  smart  replacement for QB's new SLEEP statement
  93.           (which, by the way, takes over 2K of executable code).   The
  94.           delay   can   either  be  forced or user bypassed  with  any
  95.           key or mouse button.
  96.  
  97.  
  98.           Access to system interrupts:  QB.QLB/QB.LIB/QB.BI (C)
  99.  
  100.           Incorporated  within  this  library  are QuickBASIC's QB.QLB
  101.           (C), QB.LIB (C) and QB.BI (C).  These files  were  necessary
  102.           for  writing the mouse routines.  Because of their presence,
  103.           you also have access  to  DOS  service  calls.   This  is  a
  104.           powerful feature for any programmer.
  105.  
  106.  
  107.  
  108.                **   What the Q4Tool Library does not provide   **
  109.               ====================================================
  110.  
  111.  
  112.           Q4Tool  does  not  contain routines for data input or manip-
  113.           ulation.  It is felt these  type  of  procedures  should  be
  114.           handled  by  the programmer for their particular application
  115.           needs.  Absent also from this library is  the  abundance  of
  116.           routines  that  can't  possibly  be  incorporated into every
  117.           program.  Q4T is intended to be a small library  from  which
  118.           to build from.
  119.  
  120.  
  121.                **   The nuts and bolts of the Q4Tool Library   **
  122.               ====================================================
  123.  
  124.  
  125.           The following is a clarified description of  the  prototypes
  126.           used in the CALL's to these Q4Tool library routines.  Please
  127.           note  the  variable  types  used  for the arguments in these
  128.           routines.  The mouse service calls are designed to work with
  129.           a Microsoft (R) mouse driver or close compatible.
  130.  
  131.  
  132.           -------------------
  133.           MouseStatus(Ready%)
  134.           -------------------
  135.           This routine does a nondestructive interrupt vector check to
  136.           determine  the  existence  of  a mouse driver.  This routine
  137.           should be called prior to using any of the other  Q4T  mouse
  138.           routines  to  insure  the  presence  of  the mouse interrupt
  139.           (33H).
  140.  
  141.           Passed:  An integer variable
  142.  
  143.           Returns: 0 if a mouse driver is not detected
  144.                    1 if a mouse driver has been installed
  145.  
  146.           Example:  CALL MouseStatus(have%)
  147.  
  148.  
  149.           ----------------
  150.           MouseReset(Set%)
  151.           ----------------
  152.           This routine will initialize the mouse driver and will allow
  153.           the saving and restoring of two separate mouse states.
  154.  
  155.           Passed:  An initialized integer variable or constant
  156.                    0 = hard reset - initializes mouse driver, turns
  157.                        mouse pointer off and disables any prior
  158.                        user installed events (function 00H)
  159.                    1 = soft reset - reset mouse driver and turns
  160.                        pointer off (function 21H)
  161.                    2 = will save the current mouse state to mouse
  162.                        buffer #1
  163.                    3 = will restore the mouse state as saved in mouse
  164.                        buffer #1
  165.                    4 = will save the current mouse state to mouse
  166.                        buffer #2
  167.                    5 = will restore the mouse state as saved in mouse
  168.                        buffer #2
  169.  
  170.           Returns:  If passed a variable initialized to 0, will reset
  171.                     mouse and return number of buttons installed, else
  172.                     returns nothing
  173.  
  174.           Example:  buttons% = 0
  175.                     CALL MouseReset(buttons%)
  176.  
  177.  
  178.           ----------------------
  179.           MouseVersion(Version$)
  180.           ----------------------
  181.           This routine will return both the major and minor version of
  182.           the mouse driver installed.
  183.  
  184.           Passed:  A string variable at lease 5 characters in length
  185.  
  186.           Returns:  A string containing the version of the mouse
  187.                     driver installed.  (i.e., 6.123)
  188.  
  189.           Example:  CALL MouseVersion(ver$)
  190.  
  191.  
  192.           ---------------------
  193.           MouseVisible(Status%)
  194.           ---------------------
  195.           This routine will allow  the  mouse  pointer  to  be  either
  196.           turned  on  or  off.  This routine has been stabilized by an
  197.           internal variable